<?php
/*
 * @Author: 哲学家乔布斯 <wuyangii@qq.com>
 * @Date: 2022-10-20 21:41:37
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-11-07 22:37:15
 * @Descripttion: 系统配置
 */

namespace app\api\controller\collection\v1_0;



class Upload extends Common
{
    protected $noNeedRight = ['test'];
    /**
     * @Author: 哲学家乔布斯 <wuyangii@qq.com>
     * @brief: 
     * @return 
     * @Descripttion: 首页默认接口
     */    
    public function index(){
        $param = request()->param();
        $result = (new \app\common\controller\Upload())
                ->COSUploadFile('images/' . date('Ymd') . '/' .date('YmdHis') . rand(1000, 9999).".png",$param['url']);
        if($result['state'] == 1){
            return self::successResult("成功",$result['url']);
        }else{
            return self::errorResult("失败",$result['msg']);
        }
       
    }

    
    

}
